<template>
    <div>
        <el-form ref="form" :model="form" label-width="100px" style="padding:10px;">
            <el-form-item label="名称" prop="dbName">
            <el-input v-model="form.dbName" placeholder="请输入数据库名称" />
            </el-form-item>
            <el-form-item label="连接串" prop="dbUrl">
            <el-input v-model="form.dbUrl" placeholder="请输入数据库连接串" />
            </el-form-item>
            <el-form-item label="用户名" prop="userName">
            <el-input v-model="form.userName" placeholder="请输入用户名" />
            </el-form-item>
            <el-form-item label="密码" prop="userPass">
            <el-input v-model="form.userPass" type="password"  auto-complete="new-password" placeholder="请输入密码" />
            </el-form-item>
            <el-form-item label="默认数据库" prop="defaultSchema">
            <el-input v-model="form.defaultSchema" placeholder="请输入模型数据库" />
            </el-form-item>
        </el-form>
      </div>
</template>

<<script>
import { getBase } from "@/api/db/base";


export default {
    dicts: ['sys_data_type'],
    props: {
        dbId: {
            type: Number
        }
    },
    data() {
        return {
            // 遮罩层
            loading: true,
            form:{}
        }
    },
    created() {
        this.getInfo();    
    },
    methods: {
        getInfo() {
            const dbId = this.dbId
            getBase(dbId).then(response => {
                this.form = response.data;
            });
        }
    }
}


</script>